package com.learn.sb.netty.server;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class SpringBootNettyServerApplication implements CommandLineRunner {

	@Value("${netty.server.port}")
	private int port;

	public static void main(String[] args) {
		SpringApplication.run(SpringBootNettyServerApplication.class, args);
	}

	@Override
	public void run(String... args) throws Exception {
		new EchoServer(port).start();
	}
}
